#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
    int arr[7] = {0};
    while (scanf("%d", &arr[0]) != 0)
    {
        int i = 0;
        int max = 0;
        int min = 0;
        float sum = arr[0];
        for (i = 1; i < 7; i++)
        {
            scanf("%d", &arr[i]);
            if (i == 1)
            {
                max = arr[0] > arr[1] ? arr[0] : arr[1];
                min = arr[0] < arr[1] ? arr[0] : arr[1];
            }
            else if (i > 1)
            {
                max = max > arr[i] ? max : arr[i];
                min = min < arr[i] ? min : arr[i];
            }
            sum += arr[i];
        }
        printf("%.2f\n", (sum - max - min) / 5.0);
    }
    return 0;
}